package com.wbs.shop.nuby.view.listener;

import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.wbs.shop.nuby.utils.Logger;

import java.lang.ref.WeakReference;

/**
 * Created by Administrator on 2017/9/23.
 */

public class SmartRefreshListener implements RefreshListener {
    WeakReference<RefreshLayout> wfRefreshLayout;

    public SmartRefreshListener(RefreshLayout refreshLayout) {
        wfRefreshLayout = new WeakReference<>(refreshLayout);
    }

    @Override
    public void stopRefresh() {
        try {
            wfRefreshLayout.get().finishRefresh(0);
            wfRefreshLayout.get().finishLoadMore(0);
        } catch (Exception e) {
            Logger.e(e);
        }
    }
}
